public class Test {
    public static void main(String[] args) {
        //认识匿名内部类,并掌握其作用
//        Animal a = new Cat();
//        a.cry();

        Animal a =  new Animal(){
            @Override
            public void cry() {
                System.out.println("猫叫");
            }
        };
        a.cry();

    }
}

//class Cat extends Animal{
//    @Override
//    public void cry() {
//        System.out.println("猫叫");
//    }
//}


abstract class Animal{
    public abstract void cry();
}